<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     compiler.tplheader.php
 * Type:     compiler
 * Name:     tplheader
 * Purpose:  Output header containing the source file name and
 *           the time it was compiled.
 * -------------------------------------------------------------
 */
function tpl_compiler_img($attrs, &$smarty) {
    $imgLib = array(
/*- begin -*/

'images/bundle/addcate.gif'=>'width:16px;height:16px;background-position:0 -0px;',
'images/bundle/afresh.gif'=>'width:16px;height:16px;background-position:0 -16px;',
'images/bundle/afresh_off.gif'=>'width:16px;height:16px;background-position:0 -32px;',
'images/bundle/arrow-down.gif'=>'width:7px;height:5px;background-position:0 -48px;',
'images/bundle/arrow-left.gif'=>'width:5px;height:9px;background-position:0 -53px;',
'images/bundle/arrow-right.gif'=>'width:5px;height:9px;background-position:0 -62px;',
'images/bundle/arrow-up.gif'=>'width:7px;height:5px;background-position:0 -71px;',
'images/bundle/blue-dot.gif'=>'width:12px;height:12px;background-position:0 -76px;',
'images/bundle/btn_add.gif'=>'width:14px;height:14px;background-position:0 -88px;',
'images/bundle/btn_download.gif'=>'width:15px;height:16px;background-position:0 -102px;',
'images/bundle/btn_edit.gif'=>'width:15px;height:16px;background-position:0 -118px;',
'images/bundle/btn_get_world.gif'=>'width:16px;height:16px;background-position:0 -134px;',
'images/bundle/clock.gif'=>'width:16px;height:16px;background-position:0 -150px;',
'images/bundle/closeBtn.gif'=>'width:16px;height:16px;background-position:0 -166px;',
'images/bundle/close_btn.gif'=>'width:17px;height:17px;background-position:0 -182px;',
'images/bundle/delecate.gif'=>'width:16px;height:16px;background-position:0 -199px;',
'images/bundle/delete.gif'=>'width:12px;height:10px;background-position:0 -215px;',
'images/bundle/disabled.gif'=>'width:16px;height:16px;background-position:0 -225px;',
'images/bundle/downinfo.gif'=>'width:13px;height:14px;background-position:0 -241px;',
'images/bundle/downinfo_off.gif'=>'width:13px;height:14px;background-position:0 -255px;',
'images/bundle/editcate.gif'=>'width:16px;height:16px;background-position:0 -269px;',
'images/bundle/enabled.gif'=>'width:16px;height:16px;background-position:0 -285px;',
'images/bundle/finder_add.gif'=>'width:24px;height:24px;background-position:0 -301px;',
'images/bundle/finder_back.gif'=>'width:24px;height:24px;background-position:0 -325px;',
'images/bundle/finder_data_refresh.gif'=>'width:24px;height:24px;background-position:0 -349px;',
'images/bundle/finder_date.gif'=>'width:22px;height:24px;background-position:0 -373px;',
'images/bundle/finder_drop_arrow.gif'=>'width:16px;height:16px;background-position:0 -397px;',
'images/bundle/finder_drop_arrow_close.gif'=>'width:16px;height:16px;background-position:0 -413px;',
'images/bundle/finder_drop_arrow_up.gif'=>'width:16px;height:16px;background-position:0 -429px;',
'images/bundle/finder_filter.gif'=>'width:26px;height:24px;background-position:0 -445px;',
'images/bundle/finder_io.gif'=>'width:25px;height:24px;background-position:0 -469px;',
'images/bundle/finder_list_edit.gif'=>'width:16px;height:16px;background-position:0 -493px;',
'images/bundle/finder_mail.gif'=>'width:22px;height:24px;background-position:0 -509px;',
'images/bundle/finder_massive.gif'=>'width:22px;height:24px;background-position:0 -533px;',
'images/bundle/finder_movetop.gif'=>'width:20px;height:24px;background-position:0 -557px;',
'images/bundle/finder_print.gif'=>'width:22px;height:24px;background-position:0 -581px;',
'images/bundle/finder_print_style.gif'=>'width:24px;height:24px;background-position:0 -605px;',
'images/bundle/finder_refresh.gif'=>'width:22px;height:24px;background-position:0 -629px;',
'images/bundle/finder_search_btn.gif'=>'width:19px;height:17px;background-position:0 -653px;',
'images/bundle/finder_sheet.gif'=>'width:21px;height:24px;background-position:0 -670px;',
'images/bundle/finder_tag.gif'=>'width:18px;height:24px;background-position:0 -694px;',
'images/bundle/finder_tpl.gif'=>'width:24px;height:24px;background-position:0 -718px;',
'images/bundle/finder_trash.gif'=>'width:17px;height:24px;background-position:0 -742px;',
'images/bundle/finder_trash_rev.gif'=>'width:22px;height:24px;background-position:0 -766px;',
'images/bundle/finder_view_trash.gif'=>'width:17px;height:24px;background-position:0 -790px;',
'images/bundle/folder_page.gif'=>'width:16px;height:16px;background-position:0 -814px;',
'images/bundle/gears_ico.gif'=>'width:16px;height:16px;background-position:0 -830px;',
'images/bundle/handle-hide.gif'=>'width:12px;height:12px;background-position:0 -846px;',
'images/bundle/handle-show.gif'=>'width:12px;height:12px;background-position:0 -858px;',
'images/bundle/help-about.gif'=>'width:16px;height:16px;background-position:0 -870px;',
'images/bundle/hidden.gif'=>'width:24px;height:16px;background-position:0 -886px;',
'images/bundle/ico-buy.gif'=>'width:14px;height:18px;background-position:0 -902px;',
'images/bundle/ico-chat.gif'=>'width:16px;height:16px;background-position:0 -920px;',
'images/bundle/ico_help.gif'=>'width:16px;height:16px;background-position:0 -936px;',
'images/bundle/icon_asc.gif'=>'width:13px;height:12px;background-position:0 -952px;',
'images/bundle/icon_asc_2.gif'=>'width:13px;height:12px;background-position:0 -964px;',
'images/bundle/icon_desc.gif'=>'width:13px;height:12px;background-position:0 -976px;',
'images/bundle/icon_desc_2.gif'=>'width:13px;height:12px;background-position:0 -988px;',
'images/bundle/mceico_0.gif'=>'width:16px;height:16px;background-position:0 -1000px;',
'images/bundle/mceico_1.gif'=>'width:16px;height:16px;background-position:0 -1016px;',
'images/bundle/mceico_10.gif'=>'width:16px;height:16px;background-position:0 -1032px;',
'images/bundle/mceico_11.gif'=>'width:16px;height:16px;background-position:0 -1048px;',
'images/bundle/mceico_12.gif'=>'width:16px;height:16px;background-position:0 -1064px;',
'images/bundle/mceico_13.gif'=>'width:16px;height:16px;background-position:0 -1080px;',
'images/bundle/mceico_14.gif'=>'width:16px;height:16px;background-position:0 -1096px;',
'images/bundle/mceico_15.gif'=>'width:16px;height:16px;background-position:0 -1112px;',
'images/bundle/mceico_16.gif'=>'width:16px;height:16px;background-position:0 -1128px;',
'images/bundle/mceico_17.gif'=>'width:16px;height:16px;background-position:0 -1144px;',
'images/bundle/mceico_18.gif'=>'width:16px;height:16px;background-position:0 -1160px;',
'images/bundle/mceico_19.gif'=>'width:16px;height:16px;background-position:0 -1176px;',
'images/bundle/mceico_2.gif'=>'width:16px;height:16px;background-position:0 -1192px;',
'images/bundle/mceico_20.gif'=>'width:16px;height:16px;background-position:0 -1208px;',
'images/bundle/mceico_21.gif'=>'width:16px;height:16px;background-position:0 -1224px;',
'images/bundle/mceico_22.gif'=>'width:16px;height:16px;background-position:0 -1240px;',
'images/bundle/mceico_23.gif'=>'width:16px;height:16px;background-position:0 -1256px;',
'images/bundle/mceico_24.gif'=>'width:16px;height:16px;background-position:0 -1272px;',
'images/bundle/mceico_25.gif'=>'width:16px;height:16px;background-position:0 -1288px;',
'images/bundle/mceico_26.gif'=>'width:16px;height:16px;background-position:0 -1304px;',
'images/bundle/mceico_27.gif'=>'width:16px;height:16px;background-position:0 -1320px;',
'images/bundle/mceico_28.gif'=>'width:16px;height:16px;background-position:0 -1336px;',
'images/bundle/mceico_29.gif'=>'width:16px;height:16px;background-position:0 -1352px;',
'images/bundle/mceico_3.gif'=>'width:16px;height:16px;background-position:0 -1368px;',
'images/bundle/mceico_30.gif'=>'width:16px;height:16px;background-position:0 -1384px;',
'images/bundle/mceico_31.gif'=>'width:16px;height:16px;background-position:0 -1400px;',
'images/bundle/mceico_32.gif'=>'width:16px;height:16px;background-position:0 -1416px;',
'images/bundle/mceico_33.gif'=>'width:16px;height:16px;background-position:0 -1432px;',
'images/bundle/mceico_34.gif'=>'width:16px;height:16px;background-position:0 -1448px;',
'images/bundle/mceico_35.gif'=>'width:16px;height:16px;background-position:0 -1464px;',
'images/bundle/mceico_36.gif'=>'width:16px;height:16px;background-position:0 -1480px;',
'images/bundle/mceico_37.gif'=>'width:16px;height:16px;background-position:0 -1496px;',
'images/bundle/mceico_38.gif'=>'width:16px;height:16px;background-position:0 -1512px;',
'images/bundle/mceico_39.gif'=>'width:16px;height:16px;background-position:0 -1528px;',
'images/bundle/mceico_4.gif'=>'width:16px;height:16px;background-position:0 -1544px;',
'images/bundle/mceico_40.gif'=>'width:16px;height:16px;background-position:0 -1560px;',
'images/bundle/mceico_41.gif'=>'width:16px;height:16px;background-position:0 -1576px;',
'images/bundle/mceico_42.gif'=>'width:16px;height:16px;background-position:0 -1592px;',
'images/bundle/mceico_43.gif'=>'width:16px;height:16px;background-position:0 -1608px;',
'images/bundle/mceico_44.gif'=>'width:16px;height:16px;background-position:0 -1624px;',
'images/bundle/mceico_45.gif'=>'width:16px;height:16px;background-position:0 -1640px;',
'images/bundle/mceico_46.gif'=>'width:16px;height:16px;background-position:0 -1656px;',
'images/bundle/mceico_47.gif'=>'width:16px;height:16px;background-position:0 -1672px;',
'images/bundle/mceico_48.gif'=>'width:30px;height:16px;background-position:0 -1688px;',
'images/bundle/mceico_5.gif'=>'width:16px;height:16px;background-position:0 -1704px;',
'images/bundle/mceico_6.gif'=>'width:16px;height:16px;background-position:0 -1720px;',
'images/bundle/mceico_7.gif'=>'width:16px;height:16px;background-position:0 -1736px;',
'images/bundle/mceico_8.gif'=>'width:16px;height:16px;background-position:0 -1752px;',
'images/bundle/mceico_9.gif'=>'width:16px;height:16px;background-position:0 -1768px;',
'images/bundle/minus.gif'=>'width:12px;height:12px;background-position:0 -1784px;',
'images/bundle/new_window.gif'=>'width:16px;height:16px;background-position:0 -1796px;',
'images/bundle/notebook_pencil.gif'=>'width:16px;height:16px;background-position:0 -1812px;',
'images/bundle/ok.gif'=>'width:24px;height:16px;background-position:0 -1828px;',
'images/bundle/opguide_ico.gif'=>'width:16px;height:16px;background-position:0 -1844px;',
'images/bundle/page_edit.gif'=>'width:16px;height:16px;background-position:0 -1860px;',
'images/bundle/page_new.gif'=>'width:16px;height:16px;background-position:0 -1876px;',
'images/bundle/page_script.gif'=>'width:16px;height:16px;background-position:0 -1892px;',
'images/bundle/plus.gif'=>'width:12px;height:12px;background-position:0 -1908px;',
'images/bundle/return.gif'=>'width:10px;height:10px;background-position:0 -1920px;',
'images/bundle/save.gif'=>'width:16px;height:16px;background-position:0 -1930px;',
'images/bundle/saveaddsame.gif'=>'width:16px;height:16px;background-position:0 -1946px;',
'images/bundle/savereturn.gif'=>'width:16px;height:16px;background-position:0 -1962px;',
'images/bundle/savesetdef.gif'=>'width:16px;height:16px;background-position:0 -1978px;',
'images/bundle/savetolist.gif'=>'width:16px;height:16px;background-position:0 -1994px;',
'images/bundle/showcate.gif'=>'width:16px;height:16px;background-position:0 -2010px;',
'images/bundle/sidemaps-action.gif'=>'width:16px;height:16px;background-position:0 -2026px;',
'images/bundle/sidemaps-articles.gif'=>'width:16px;height:16px;background-position:0 -2042px;',
'images/bundle/sidemaps-custompage.gif'=>'width:16px;height:16px;background-position:0 -2058px;',
'images/bundle/sidemaps-goodpackage.gif'=>'width:16px;height:16px;background-position:0 -2074px;',
'images/bundle/sidemaps-goodsCat.gif'=>'width:16px;height:16px;background-position:0 -2090px;',
'images/bundle/sidemaps-layouts.gif'=>'width:16px;height:16px;background-position:0 -2106px;',
'images/bundle/sidemaps-links.gif'=>'width:16px;height:16px;background-position:0 -2122px;',
'images/bundle/sidemaps-page.gif'=>'width:16px;height:16px;background-position:0 -2138px;',
'images/bundle/sidemaps-pageurl.gif'=>'width:16px;height:16px;background-position:0 -2154px;',
'images/bundle/sitemap-closed.gif'=>'width:16px;height:16px;background-position:0 -2170px;',
'images/bundle/sitemapclosed.gif'=>'width:9px;height:9px;background-position:0 -2186px;',
'images/bundle/sitemapopened.gif'=>'width:9px;height:9px;background-position:0 -2195px;',
'images/bundle/sitemaps-opened.gif'=>'width:16px;height:16px;background-position:0 -2204px;',
'images/bundle/spage_editing.gif'=>'width:16px;height:16px;background-position:0 -2220px;',
'images/bundle/success.gif'=>'width:16px;height:16px;background-position:0 -2236px;',
'images/bundle/tag_all.gif'=>'width:9px;height:9px;background-position:0 -2252px;',
'images/bundle/tag_none.gif'=>'width:9px;height:9px;background-position:0 -2261px;',
'images/bundle/tag_part.gif'=>'width:9px;height:9px;background-position:0 -2270px;',
'images/bundle/tips.gif'=>'width:18px;height:18px;background-position:0 -2279px;',
'images/bundle/to_down.gif'=>'width:16px;height:16px;background-position:0 -2297px;',
'images/bundle/to_up.gif'=>'width:16px;height:16px;background-position:0 -2313px;',
'images/bundle/tupian_1.gif'=>'width:17px;height:17px;background-position:0 -2329px;',
'images/bundle/tupian_2.gif'=>'width:17px;height:17px;background-position:0 -2346px;',
'images/bundle/tupian_3.gif'=>'width:17px;height:17px;background-position:0 -2363px;',
'images/bundle/tupian_4.gif'=>'width:17px;height:17px;background-position:0 -2380px;',
'images/bundle/tupian_5.gif'=>'width:17px;height:17px;background-position:0 -2397px;',
'images/bundle/tupian_6.gif'=>'width:17px;height:17px;background-position:0 -2414px;',
'images/bundle/tupian_7.gif'=>'width:17px;height:17px;background-position:0 -2431px;',
'images/bundle/view_detailed.gif'=>'width:28px;height:28px;background-position:0 -2448px;',
'images/bundle/view_text.gif'=>'width:28px;height:28px;background-position:0 -2476px;',
'images/bundle/visible.gif'=>'width:24px;height:16px;background-position:0 -2504px;',
'images/bundle/zoom_btn.gif'=>'width:18px;height:19px;background-position:0 -2520px;',

/*- end -*/
    );
    if(isset($attrs['tag'])){
        if($attrs['tag']{0}=='\'' || $attrs['src']{0}=='"'){
            $tag = substr($attrs['tag'],1,-1);
        }else{
            $tag = $attrs['tag'];
        }
    }else{
        $tag = 'img';
    }

    $html = '?><'.$tag.' ';
    if($attrs['src']{0}=='\'' || $attrs['src']{0}=='"'){
        $src = substr($attrs['src'],1,-1);
    }else{
        $src = $attrs['src'];
    }

    if($attrs['class']){
        $attrs['class'] = '"imgbundle '.(($attrs['class']{0}=='"' || $attrs['class']{0}=='\'')?substr($attrs['class'],1,-1):$attrs['class']).'"';
    }else{
        $attrs['class'] = '"imgbundle"';
    }

    if(isset($imgLib[$src])){
        $attrs['src'] =  '"images/transparent.gif"';
        if($attrs['style']){
            $attrs['style'] = '"'.$imgLib[$src].';'.(($attrs['style']{0}=='"' || $attrs['style']{0}=='\'')?substr($attrs['style'],1,-1):$attrs['style']).'"';
        }else{
            $attrs['style'] = '"'.$imgLib[$src].'"';
        }
    }else{
        if($attrs['style']){
            $attrs['style'] = '"background-image: none;'.(($attrs['style']{0}=='"' || $attrs['style']{0}=='\'')?substr($attrs['style'],1,-1):$attrs['style']).'"';
        }else{
            $attrs['style'] = '"background-image: none;"';
        }
    }
    foreach($attrs as $k=>$v){
        $html.=$k.'='.((strpos($v,'$')===false)?$v:'"<?php echo '.$v.';?>"').' ';
    }
    return $html.' /><?php ';
}
?>